package com.lefull.lefullbase.utils.OkGoHelper;


import org.json.JSONObject;


interface ParserInterface {
    public JSONObject parserJSONObject() throws Exception;

    public ResponseEntity parserModelResponse(String jsonString);
}

public class ParserBaseModel implements ParserInterface {

    public String jsonString;

    @Override
    public JSONObject parserJSONObject() throws Exception {
        try {
            JSONObject jsonObject = new JSONObject(jsonString);
            return jsonObject;
        } catch (Throwable throwable) {
            throw new Exception("JSON解析异常");
        }
    }

    @Override
    public ResponseEntity parserModelResponse(String jsonString) {
        this.jsonString = jsonString;
        return null;
    }
}
